package cn.com.listener;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class SessionListenerTest implements HttpSessionListener {

	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		// 创建session时被调用
		HttpSession session = arg0.getSession();// 新创建的Session
		System.out.println("新创建了一个session：" + session);

	}

	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		// 销毁session前被调用
		HttpSession session = arg0.getSession();//即将被销毁的session
		System.out.println("销毁了一个session：" + session);

	}

}
